﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

public class TaDiao : MonoBehaviour 
{
    private Animator ani;

    public event Action onAnimationFinish;
    public event Action OnHitPlayer;
    public event Action OnHitGround;


    void Start () 
	{
        ani = GetComponent<Animator>();
	}
	
    public void PlayAnimation()
    {
        ani.SetBool("isPlay", true);
    }

    /// <summary>
    /// 动画回调
    /// </summary>
    public void Player_OnNear()
    {
        OnHitPlayer();
        Invoke("PlayHitGroundSound",6f);
    }

    void PlayHitGroundSound()
    {
        
        OnHitGround();

    }



    /// <summary>
    /// 播放倾倒吊装货物声音
    /// </summary>
    public void PlaySound()
    {
        SoundManager.instance.Play("gangguanqingdao");
    }

}
